<template>
  <view class="classLayout pageBg">
    <!-- 头部导航组件 -->
    <custom-nav-bar title="分类"></custom-nav-bar>
    <view class="classify">
      <theme-item
        v-for="item in classifyList"
        :item="item"
        :key="item._id"
      ></theme-item>
    </view>
  </view>
</template>

<script setup>
import { ref } from "vue";
import { apiGetClassify } from "@/api/apis";
import { onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app";
const classifyList = ref([]);

const getClassify = async (id = 1) => {
  const res = await apiGetClassify(id);
  classifyList.value = res.data;
};
getClassify();

// 分享
onShareAppMessage((e) => {
  return {
    title: " 贝贝壁纸",
    path: "/pages/classify/classify",
  };
});
</script>

<style lang="scss" scoped>
.classLayout {
  .classify {
    padding: 30rpx;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15rpx;
  }
}
</style>
